{% extends "base.html" %}
{% block content %}
<div id="content">
    {% load thumbnail %}
    {% for img in object_list %}
        {%  if forloop.first %}<h1>{{ img.content_object.title }}</h1>{% endif %}
  <div class="category">
      <a href="{{ MEDIA_URL }}{{ img.img }}" rel="gallery" title="{{ img.title }}">{% thumbnail img.img "x250" as im %}<img src="{{ im.url }}">{% endthumbnail %}</a></div>
    {%  endfor %}
{% if is_paginated %}
<div id="pagination">
        <ul>
            {% if page_obj.has_previous %}
            <li class="previous-off"><a href="{{ request.path }}?page={{ page_obj.previous_page_number }}">&lt;&lt;&lt;</a></li>
            <li><a href="{{ request.path }}?page={{ page_obj.previous_page_number }}">{{ page_obj.previous_page_number }}</a></li>
            {%  else %}
            <li class="previous-off">&lt;&lt;&lt;</li>
            {% endif %}
            <li class="active-page">{{ page_obj.number }}</li>
        <!--
            <li><a href="">2</a></li>
            <li><a href="">3</a></li>
            <li><a href="">4</a></li>
            <li><a href="">5</a></li>
            -->
        {% if page_obj.has_next %}
            <li><a href="{{ request.path }}?page={{ page_obj.next_page_number }}">{{ page_obj.next_page_number }}</a></li>
            {% comment %}{% ifequal page_obj.number 1 %}
                        <li><a href="{{ request.path }}?page=3">3</a></li>
            {% endifequal %}
            {% endcomment %}
            <li class="next-off"><a href="{{ request.path }}?page={{ page_obj.next_page_number }}">&gt;&gt;&gt;</a></li>
            {%  else %}
            <li class="next-off">&gt;&gt;&gt;</li>
            {% endif %}

        </ul>
        </div>
{% endif %}
</div>
{% endblock %}